function AgentConf(params){ 
	 
}

AgentConf.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new AgentConf.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new AgentConf.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new AgentConf.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 所属品牌  [Merchant]      **/
	this.merchant=function(merchant){if(this.proxy)return this.getProxy().merchant(merchant);  this.put("merchant", merchant);return this;};
	/** and merchant is null */
	this.merchantNull=function(){if(this.proxy)return this.getProxy().merchantNull();if(this.get("merchantNot")==null)this.put("merchantNot", "");this.put("merchant", null);return this;};
	/** not .... */
	this.merchantNot=function(){if(this.proxy)return this.getProxy().merchantNot();this.put("merchantNot", "not");return this;};
	this.merchantNotNull=function(){if(this.proxy)return this.getProxy().merchantNotNull();this.put("merchantNot", "not");this.put("merchant", null);return this;};
	this.merchantNot=function(merchant){if(this.proxy)return this.getProxy().merchantNot(merchant);this.put("merchantNot", "not");this.put("merchant", merchant);return this;};
	this.merchantIn=function(ids){
		if(this.proxy)return this.getProxy().merchantIn(ids);  this.put("merchantIn", ids);return this;
	};	
	
	/** 名称 [非空]       **/
	this.name=function(name){if(this.proxy)return this.getProxy().name(name);  this.put("name", name);return this;};
	/** and name is null */
	this.nameNull=function(){if(this.proxy)return this.getProxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
	/** not .... */
	this.nameNot=function(){if(this.proxy)return this.getProxy().nameNot();this.put("nameNot", "not");return this;};
	this.nameNotNull=function(){if(this.proxy)return this.getProxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
	this.nameNot=function(name){if(this.proxy)return this.getProxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	
	/** 代理卡价格        **/
	this.price=function(price){if(this.proxy)return this.getProxy().price(price);  this.put("price", price);return this;};
	/** and price is null */
	this.priceNull=function(){if(this.proxy)return this.getProxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
	/** not .... */
	this.priceNot=function(){if(this.proxy)return this.getProxy().priceNot();this.put("priceNot", "not");return this;};
	this.priceNotNull=function(){if(this.proxy)return this.getProxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
	this.priceNot=function(price){if(this.proxy)return this.getProxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	/** and price <= ? */
	this.priceMin=function(min){if(this.proxy)return this.getProxy().priceMin(min);this.put("priceMin", min);return this;};
	/** and price >= ? */
	this.priceMax=function(max){if(this.proxy)return this.getProxy().priceMax(max);this.put("priceMax", max);return this;};
	
	/** 产品配置    query:commodity number:number     **/
	this.products=function(products){if(this.proxy)return this.getProxy().products(products);  this.put("products", products);return this;};
	/** and products is null */
	this.productsNull=function(){if(this.proxy)return this.getProxy().productsNull();if(this.get("productsNot")==null)this.put("productsNot", "");this.put("products", null);return this;};
	/** not .... */
	this.productsNot=function(){if(this.proxy)return this.getProxy().productsNot();this.put("productsNot", "not");return this;};
	this.productsNotNull=function(){if(this.proxy)return this.getProxy().productsNotNull();this.put("productsNot", "not");this.put("products", null);return this;};
	this.productsNot=function(products){if(this.proxy)return this.getProxy().productsNot(products);this.put("productsNot", "not");this.put("products", products);return this;};
	
	/** 代理直接奖励        **/
	this.dlZjJl=function(dlZjJl){if(this.proxy)return this.getProxy().dlZjJl(dlZjJl);  this.put("dlZjJl", dlZjJl);return this;};
	/** and dl_zj_jl is null */
	this.dlZjJlNull=function(){if(this.proxy)return this.getProxy().dlZjJlNull();if(this.get("dlZjJlNot")==null)this.put("dlZjJlNot", "");this.put("dlZjJl", null);return this;};
	/** not .... */
	this.dlZjJlNot=function(){if(this.proxy)return this.getProxy().dlZjJlNot();this.put("dlZjJlNot", "not");return this;};
	this.dlZjJlNotNull=function(){if(this.proxy)return this.getProxy().dlZjJlNotNull();this.put("dlZjJlNot", "not");this.put("dlZjJl", null);return this;};
	this.dlZjJlNot=function(dlZjJl){if(this.proxy)return this.getProxy().dlZjJlNot(dlZjJl);this.put("dlZjJlNot", "not");this.put("dlZjJl", dlZjJl);return this;};
	/** and dl_zj_jl <= ? */
	this.dlZjJlMin=function(min){if(this.proxy)return this.getProxy().dlZjJlMin(min);this.put("dlZjJlMin", min);return this;};
	/** and dl_zj_jl >= ? */
	this.dlZjJlMax=function(max){if(this.proxy)return this.getProxy().dlZjJlMax(max);this.put("dlZjJlMax", max);return this;};
	
	/** 代理间接奖励        **/
	this.dlJjJl=function(dlJjJl){if(this.proxy)return this.getProxy().dlJjJl(dlJjJl);  this.put("dlJjJl", dlJjJl);return this;};
	/** and dl_jj_jl is null */
	this.dlJjJlNull=function(){if(this.proxy)return this.getProxy().dlJjJlNull();if(this.get("dlJjJlNot")==null)this.put("dlJjJlNot", "");this.put("dlJjJl", null);return this;};
	/** not .... */
	this.dlJjJlNot=function(){if(this.proxy)return this.getProxy().dlJjJlNot();this.put("dlJjJlNot", "not");return this;};
	this.dlJjJlNotNull=function(){if(this.proxy)return this.getProxy().dlJjJlNotNull();this.put("dlJjJlNot", "not");this.put("dlJjJl", null);return this;};
	this.dlJjJlNot=function(dlJjJl){if(this.proxy)return this.getProxy().dlJjJlNot(dlJjJl);this.put("dlJjJlNot", "not");this.put("dlJjJl", dlJjJl);return this;};
	/** and dl_jj_jl <= ? */
	this.dlJjJlMin=function(min){if(this.proxy)return this.getProxy().dlJjJlMin(min);this.put("dlJjJlMin", min);return this;};
	/** and dl_jj_jl >= ? */
	this.dlJjJlMax=function(max){if(this.proxy)return this.getProxy().dlJjJlMax(max);this.put("dlJjJlMax", max);return this;};
	
	/** 分销直接奖励 [非空]       **/
	this.fxZjJl=function(fxZjJl){if(this.proxy)return this.getProxy().fxZjJl(fxZjJl);  this.put("fxZjJl", fxZjJl);return this;};
	/** and fx_zj_jl is null */
	this.fxZjJlNull=function(){if(this.proxy)return this.getProxy().fxZjJlNull();if(this.get("fxZjJlNot")==null)this.put("fxZjJlNot", "");this.put("fxZjJl", null);return this;};
	/** not .... */
	this.fxZjJlNot=function(){if(this.proxy)return this.getProxy().fxZjJlNot();this.put("fxZjJlNot", "not");return this;};
	this.fxZjJlNotNull=function(){if(this.proxy)return this.getProxy().fxZjJlNotNull();this.put("fxZjJlNot", "not");this.put("fxZjJl", null);return this;};
	this.fxZjJlNot=function(fxZjJl){if(this.proxy)return this.getProxy().fxZjJlNot(fxZjJl);this.put("fxZjJlNot", "not");this.put("fxZjJl", fxZjJl);return this;};
	/** and fx_zj_jl <= ? */
	this.fxZjJlMin=function(min){if(this.proxy)return this.getProxy().fxZjJlMin(min);this.put("fxZjJlMin", min);return this;};
	/** and fx_zj_jl >= ? */
	this.fxZjJlMax=function(max){if(this.proxy)return this.getProxy().fxZjJlMax(max);this.put("fxZjJlMax", max);return this;};
	
	/** 分销间接奖励        **/
	this.fxJjJl=function(fxJjJl){if(this.proxy)return this.getProxy().fxJjJl(fxJjJl);  this.put("fxJjJl", fxJjJl);return this;};
	/** and fx_jj_jl is null */
	this.fxJjJlNull=function(){if(this.proxy)return this.getProxy().fxJjJlNull();if(this.get("fxJjJlNot")==null)this.put("fxJjJlNot", "");this.put("fxJjJl", null);return this;};
	/** not .... */
	this.fxJjJlNot=function(){if(this.proxy)return this.getProxy().fxJjJlNot();this.put("fxJjJlNot", "not");return this;};
	this.fxJjJlNotNull=function(){if(this.proxy)return this.getProxy().fxJjJlNotNull();this.put("fxJjJlNot", "not");this.put("fxJjJl", null);return this;};
	this.fxJjJlNot=function(fxJjJl){if(this.proxy)return this.getProxy().fxJjJlNot(fxJjJl);this.put("fxJjJlNot", "not");this.put("fxJjJl", fxJjJl);return this;};
	/** and fx_jj_jl <= ? */
	this.fxJjJlMin=function(min){if(this.proxy)return this.getProxy().fxJjJlMin(min);this.put("fxJjJlMin", min);return this;};
	/** and fx_jj_jl >= ? */
	this.fxJjJlMax=function(max){if(this.proxy)return this.getProxy().fxJjJlMax(max);this.put("fxJjJlMax", max);return this;};
	
	/** 分销政策        **/
	this.policy=function(policy){if(this.proxy)return this.getProxy().policy(policy);  this.put("policy", policy);return this;};
	/** and policy is null */
	this.policyNull=function(){if(this.proxy)return this.getProxy().policyNull();if(this.get("policyNot")==null)this.put("policyNot", "");this.put("policy", null);return this;};
	/** not .... */
	this.policyNot=function(){if(this.proxy)return this.getProxy().policyNot();this.put("policyNot", "not");return this;};
	this.policyNotNull=function(){if(this.proxy)return this.getProxy().policyNotNull();this.put("policyNot", "not");this.put("policy", null);return this;};
	this.policyNot=function(policy){if(this.proxy)return this.getProxy().policyNot(policy);this.put("policyNot", "not");this.put("policy", policy);return this;};
	
	/** 代理政策简述        **/
	this.purchase=function(purchase){if(this.proxy)return this.getProxy().purchase(purchase);  this.put("purchase", purchase);return this;};
	/** and purchase is null */
	this.purchaseNull=function(){if(this.proxy)return this.getProxy().purchaseNull();if(this.get("purchaseNot")==null)this.put("purchaseNot", "");this.put("purchase", null);return this;};
	/** not .... */
	this.purchaseNot=function(){if(this.proxy)return this.getProxy().purchaseNot();this.put("purchaseNot", "not");return this;};
	this.purchaseNotNull=function(){if(this.proxy)return this.getProxy().purchaseNotNull();this.put("purchaseNot", "not");this.put("purchase", null);return this;};
	this.purchaseNot=function(purchase){if(this.proxy)return this.getProxy().purchaseNot(purchase);this.put("purchaseNot", "not");this.put("purchase", purchase);return this;};
	
	/** 代理协议        **/
	this.agreement=function(agreement){if(this.proxy)return this.getProxy().agreement(agreement);  this.put("agreement", agreement);return this;};
	/** and agreement is null */
	this.agreementNull=function(){if(this.proxy)return this.getProxy().agreementNull();if(this.get("agreementNot")==null)this.put("agreementNot", "");this.put("agreement", null);return this;};
	/** not .... */
	this.agreementNot=function(){if(this.proxy)return this.getProxy().agreementNot();this.put("agreementNot", "not");return this;};
	this.agreementNotNull=function(){if(this.proxy)return this.getProxy().agreementNotNull();this.put("agreementNot", "not");this.put("agreement", null);return this;};
	this.agreementNot=function(agreement){if(this.proxy)return this.getProxy().agreementNot(agreement);this.put("agreementNot", "not");this.put("agreement", agreement);return this;};
	
	/** 权益介绍文字        **/
	this.interest=function(interest){if(this.proxy)return this.getProxy().interest(interest);  this.put("interest", interest);return this;};
	/** and interest is null */
	this.interestNull=function(){if(this.proxy)return this.getProxy().interestNull();if(this.get("interestNot")==null)this.put("interestNot", "");this.put("interest", null);return this;};
	/** not .... */
	this.interestNot=function(){if(this.proxy)return this.getProxy().interestNot();this.put("interestNot", "not");return this;};
	this.interestNotNull=function(){if(this.proxy)return this.getProxy().interestNotNull();this.put("interestNot", "not");this.put("interest", null);return this;};
	this.interestNot=function(interest){if(this.proxy)return this.getProxy().interestNot(interest);this.put("interestNot", "not");this.put("interest", interest);return this;};
	
	/** 代理加入条件        **/
	this.agentcAgentAccessionConditions=function(agentcAgentAccessionConditions){if(this.proxy)return this.getProxy().agentcAgentAccessionConditions(agentcAgentAccessionConditions);  this.put("agentcAgentAccessionConditions", agentcAgentAccessionConditions);return this;};
	/** and agentc_agent_accession_conditions is null */
	this.agentcAgentAccessionConditionsNull=function(){if(this.proxy)return this.getProxy().agentcAgentAccessionConditionsNull();if(this.get("agentcAgentAccessionConditionsNot")==null)this.put("agentcAgentAccessionConditionsNot", "");this.put("agentcAgentAccessionConditions", null);return this;};
	/** not .... */
	this.agentcAgentAccessionConditionsNot=function(){if(this.proxy)return this.getProxy().agentcAgentAccessionConditionsNot();this.put("agentcAgentAccessionConditionsNot", "not");return this;};
	this.agentcAgentAccessionConditionsNotNull=function(){if(this.proxy)return this.getProxy().agentcAgentAccessionConditionsNotNull();this.put("agentcAgentAccessionConditionsNot", "not");this.put("agentcAgentAccessionConditions", null);return this;};
	this.agentcAgentAccessionConditionsNot=function(agentcAgentAccessionConditions){if(this.proxy)return this.getProxy().agentcAgentAccessionConditionsNot(agentcAgentAccessionConditions);this.put("agentcAgentAccessionConditionsNot", "not");this.put("agentcAgentAccessionConditions", agentcAgentAccessionConditions);return this;};
	
	/** 二维码        **/
	this.qrCode=function(qrCode){if(this.proxy)return this.getProxy().qrCode(qrCode);  this.put("qrCode", qrCode);return this;};
	/** and qr_code is null */
	this.qrCodeNull=function(){if(this.proxy)return this.getProxy().qrCodeNull();if(this.get("qrCodeNot")==null)this.put("qrCodeNot", "");this.put("qrCode", null);return this;};
	/** not .... */
	this.qrCodeNot=function(){if(this.proxy)return this.getProxy().qrCodeNot();this.put("qrCodeNot", "not");return this;};
	this.qrCodeNotNull=function(){if(this.proxy)return this.getProxy().qrCodeNotNull();this.put("qrCodeNot", "not");this.put("qrCode", null);return this;};
	this.qrCodeNot=function(qrCode){if(this.proxy)return this.getProxy().qrCodeNot(qrCode);this.put("qrCodeNot", "not");this.put("qrCode", qrCode);return this;};
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有代理卡配置 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/agents/agentconf.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取代理卡配置分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/agents/agentconf.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取代理卡配置 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/agents/agentconf.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

AgentConf.get = function(id){
	var protocol = ux.ajax("/admin/agents/agentconf.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.agentConf;
	return null;
}

AgentConf.where = new AgentConf.Where(0,true);